package order

import (
	"crmeb-common/global"
	"math/big"
	"time"
)

// Order 订单表
type Order struct {
	global.BaseModel
	OrderNo string `json:"orderNo" gorm:"column=order_no;comment:订单号"`

	MerId int32 `json:"merId" gorm:"column=mer_id;comment:商户ID,商户订单等级有值"`

	Uid int32 `json:"uid" gorm:"column=uid;comment:用户id"`

	TotalNum int32 `json:"totalNum" gorm:"column=total_num;comment:订单商品总数"`

	ProTotalPrice big.Float `json:"proTotalPrice" gorm:"column=pro_total_price;comment:商品总价"`

	TotalPostage big.Float `json:"totalPostage" gorm:"column=total_postage;comment:邮费"`

	TotalPrice big.Float `json:"totalPrice" gorm:"column=total_price;comment:订单总价"`

	CouponPrice big.Float `json:"couponPrice" gorm:"column=coupon_price;comment:优惠券金额"`

	UseIntegral int32 `json:"useIntegral" gorm:"column=use_integral;comment:使用积分"`

	IntegralPrice big.Float `json:"integralPrice" gorm:"column=integral_price;comment:积分抵扣金额"`

	PayPrice big.Float `json:"payPrice" gorm:"column=pay_price;comment:实际支付金额"`

	PayPostage big.Float `json:"payPostage" gorm:"column=pay_postage;comment:支付邮费"`

	Paid bool `json:"paid" gorm:"column=paid;comment:支付状态"`

	PayTime time.Time `json:"payTime" gorm:"column=pay_time;comment:支付时间"`

	PayType string `json:"payType" gorm:"column=pay_type;comment:支付方式:weixin,alipay,yue"`

	PayChannel string `json:"payChannel" gorm:"column=pay_channel;comment:支付渠道：public-公众号,mini-小程序，h5-网页支付,yue-余额，wechatIos-微信Ios，wechatAndroid-微信Android,alipay-支付宝，alipayApp-支付宝App"`

	Status int32 `json:"status" gorm:"column=status;comment:订单状态（0：待支付，1：待发货,2：部分发货， 3：待核销，4：待收货,5：已收货,6：已完成，9：已取消）"`

	RefundStatus int32 `json:"refundStatus" gorm:"column=refund_status;comment:退款状态：0 未退款 1 申请中 2 部分退款 3 已退款"`

	CancelStatus int32 `json:"cancelStatus" gorm:"column=cancel_status;comment:取消状态：0-未取消，1-系统取消，2-用户取消"`

	IsUserDel bool `json:"isUserDel" gorm:"column=is_user_del;comment:用户是否删除"`

	IsMerchantDel bool `json:"isMerchantDel" gorm:"column=is_merchant_del;comment:商户是否删除"`

	GainIntegral int32 `json:"gainIntegral" gorm:"column=gain_integral;comment:赠送积分"`

	OutTradeNo string `json:"outTradeNo" gorm:"column=out_trade_no;comment:商户系统内部的订单号,32个字符内、可包含字母, 其他说明见商户订单号"`

	Redirect string `json:"redirect" gorm:"column=redirect;comment:支付重定向地址"`

	Type int32 `json:"type" gorm:"column=type;comment:订单类型:0-普通订单，1-视频号订单,2-秒杀订单"`

	Level int32 `json:"level" gorm:"column=level;comment:订单等级:0-平台订单，1-商户订单"`

	PlatOrderNo string `json:"platOrderNo" gorm:"column=plat_order_no;comment:平台订单号"`

	ReceivingTime time.Time `json:"receivingTime" gorm:"column=receiving_time;comment:收货时间"`

	MerCouponPrice big.Float `json:"merCouponPrice" gorm:"column=mer_coupon_price;comment:商户优惠券金额"`

	PlatCouponPrice big.Float `json:"platCouponPrice" gorm:"column=plat_coupon_price;comment:平台优惠券金额"`

	PlatCouponId int32 `json:"platCouponId" gorm:"column=plat_coupon_id;comment:平台优惠券id"`
}
